<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.w3.org/1999/xhtml">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>

<a th:href="@{/adduser}">增加</a>

<h3>搜索用户</h3>
<form th:action="@{/userlist}" method="post">
    用户名：<input type="text" name="name"><br>
    <input type="submit" value="搜索">
</form>

<table border="1">
    <tr>
        <th>用户id</th>
        <th>用户姓名</th>
        <th>用户年龄</th>
        <th>删除用户</th>
        <th>修改用户</th>
    </tr>
    <tr th:each="user:${list}">
        <td th:text="${user.id}"></td>
        <td th:text="${user.age}"></td>
        <td th:text="${user.name}"></td>
        <td>
            <a th:href="@{'/deleteUserById?id='+${user.id}}">删除</a>
        </td>
        <td>
            <a th:href="@{/updateUser(id=${user.id},age=${user.age},name=${user.name})}">修改</a>
        </td>
    </tr>

</table>
</body>
</html>